<script type="text/javascript" src="/public/library/jquery/jquery.form.js"></script>
<script src="/public/library/hvn/place.js" type="text/javascript"></script>
<style type="text/css">
    div.children_wrapper
    {
    	padding: 10px 10px 10px 30px;
    	
    }
</style>
    
<script language="Javascript">
var mode = '<?=$this->mode?>';

$(function(){
	getAddress(mode);
    getCategoryType(mode);
});
</script>

<h1 style="padding-left:10px;padding-top:20px"> <?=t(702) ?> </h1>
<br/>

<form id="form_id" accept-charset="UTF-8" action="<?= $this->escape($this->form->getAction()) ?>"
      method="<?= $this->escape($this->form->getMethod()) ?>">
<input type="hidden" name="clu_search" value="1"/>      
<table class="full-search-box"> 
<tr>
	<td width="100px"><?=t(776) ?></td>
	<td width="220px" ><?=$this->form->name ?></td>
	<td width="100px"></td>
	<td width="220px" ></td>
</tr>
<tr>
	<td width="100px"><?=t(770) ?></td>
	<td width="220px"><?=$this->form->city_id ?></td>
	<td width="100px"><?=t(771) ?></td>
	<td width="220px"><?=$this->form->district_id ?></td>
</tr>
<tr>
	<td width="100px"><?=t(781) ?></td>
	<td width="220px"><?=$this->form->str_name ?></td>
	<td width="100px"><?=t(783) ?></td>
	<td width="220px"><?=$this->form->str_number ?></td>
</tr>
<tr>
	<td width="100px"><?=t(782) ?></td>
    <td width="220px"><?=$this->form->category ?></td>
	<td width="100px"><?=t(816) ?></td>
	<td width="220px"><?=$this->form->rtype ?></td>
</tr>
</table>
	<div id="sub-type" style="padding-left: 120px;padding-top:20px">
		<!-- <table>
			<tr>
			<td id="sub-type"> </td>
			</tr>
		</table>
		<br/>-->
	</div>

<h3 style="padding-left:10px;margin-bottom:0px"> <?=t(764) ?> </h3>
<table class="full-search-box">	
<tr>
	<td width="100px"><?=t(17) ?> </td>
	<td width="220px"><?=$this->form->fee ?></td>
	<td width="100px"><?=t(18) ?></td>
	<td width="220px"><?=$this->form->to_fee ?></td>
</tr>

<tr>	
	<td width="100px"><?=t(763) ?></td>
	<td width="220px"><?=$this->form->fee_basis ?></td>
	<td width="100px"><?=t(780) ?></td>
	<td width="220px"><?=$this->form->fee_currency ?></td>
</tr>	
	<!-- 
	<?=t(784) ?>:&nbsp;&nbsp;&nbsp;
	<?=$this->form->built_year ?>
	
	<?=t(18) ?>
	<?=$this->form->to_built_year ?>
	<br/><br/>
	<?=t(785) ?>:
	<?=$this->form->payment_method ?>
	<br/>
	<?=t(757) ?>:
	<?=$this->form->meals ?>
	<br/>
	
	<?=t(759) ?>:
	<?=$this->form->delivery ?>
	<br/>
	-->

<tr>
	<td width="100px">&nbsp;</td>	
	<td width="220px"></td>
	<td width="100px"></td>
	<td> </td>
</tr>

<tr>
	<td width="100px"><b><?=t(139) ?></b></td>	
	<td width="220px"><?=t(786) ?></td>
	<td width="100px"><?=$this->form->place_perpage ?></td>
	<td> </td>
</tr>
</table>		
	<h3 style="color:green;padding-left:10px"> Admin search options </h3>
<table class="full-search-box">
<tr>
	<td width="100px"><?=t(626) ?></td>
	<td width="220px"><?=$this->form->orderBy ?></td>
	<td width="100px"><?=$this->form->asc_or_desc ?></td>
	<td> </td>
</tr>
<tr>	
	<td width="100px"><?=t(405) ?></td>
	<td width="220px"><?=$this->form->user_id ?></td>
	<td width="100px"><?=t(2) ?></td>
	<td width="220px"><?=$this->form->status ?></td>
</tr>
<tr>
	<td>Place ID</td>
	<td width="220px"><?=$this->form->id ?></td>
</tr>
<!-- 
	<?if(!empty($this->form->getArticle)) :?>
<tr>	
	<td width="100px"><?=t(523) ?></td>
	<td width="220px"><?=$this->form->getArticle ?></td>
	<td></td>
	<td></td>
</tr>
	<?endif?>
 -->		
</table>
<div style="text-align:right;padding:20px 50px 30px 0px">
	<?=$this->form->submit ?>
</div>
<?if($this->mode == "search"):?>
	<script type="text/javascript">
		
		$(function() {
			if($("select#rtype").val() != 0)
			{
				$("select#rtype").val(<?=$this->rtype;?>);
				$("select#rtype").trigger("change");
			}
		});
		
		function populate_category_checkboxes()
		{
			<!--<//?if($this->rtype != 0):?>-->
				<?if($this->type != null):?>
				<?foreach ($this->type as $t) :?>
					$("input:checkbox[name=type[]]").filter("[value=<?=$t;?>]").trigger("click");
					if ($(".parent_category_checkbox").is(':checked'))
					{
						$(".parent_category_checkbox").siblings("div.children_wrapper").show();
					}
					else
					{
						$(".parent_category_checkbox").siblings("div.children_wrapper").hide();
					}
					
				<?endforeach?>
			<?endif?>
		}
	</script>
<?endif?>	
</form>      
